import socket
buffsize=1024
client=socket.socket(socket.AF_INET,socket.NI_DGRAM)
while True:
    msg=input(">>").strip()
    ip_port=('127.0.0.1',9999)
    client.sendto(msg.encode('utf-8'),ip_port)
    data,server_addr=client.recvfrom(buffsize)
    print("接收到消息：",data,server_addr)

client.close()